(function(cjs, as){
	var p; // shortcut to reference prototypes
	//Radio
	(as.Radio=function(){
		this.Container_constructor();
		this._select=false;
		this._hover=false;
		
		this._label=new cjs.Text("Label", "18px Arial", "rgba(0,0,0,0.65)");
		this._label.setTransform(20,0);
		this._label.parent=this;
		this.addChild(this._label);
		
		var shape=new cjs.Shape();
		shape.parent=this;
		this.addChild(shape);
		
		this.reset=function(){
			shape.graphics.clear();
			var color=(this._select||this._hover)?'#1890ff':'rgba(0,0,0,0.65)';
			shape.graphics.beginFill(color);
			shape.graphics.dc(8,8,8);
			shape.graphics.beginFill('#fff');
			shape.graphics.dc(8,8,7);
			if(this._select){
				shape.graphics.beginFill(color);
				shape.graphics.dc(8,8,4);
			}
		}
		this.reset();
		
		//事件
		this.on('mouseover',function(){
			this._hover=true;
			this.reset();
		}.bind(this),null,false);
		//
		this.on('mouseout',function(){
			this._hover=false;
			this.reset();
		},null,false);
		//点击
		this.on('click',function(){
			this._select=!this._select;
			this.reset();
			//发送事件
			var evt=new cjs.Event('select');
			evt.data={select:this._select};
			this.dispatchEvent(evt);
		}.bind(this),null,false);
	});
	p=cjs.extend(as.Radio,cjs.Container);
	//text属性
	p._get_text=function(){
		return this._label.text;
	};
	p._set_text=function(value){
		this._label.text=value;
	};
	try {
		Object.defineProperties(p, {
			text: { get: p._get_text, set: p._set_text }
		});
	} catch (e) {}
	//select属性
	p._get_select=function(){
		return this._select;
	};
	p._set_select=function(value){
		this._select=value;
		this.reset();
	};
	try{
		Object.defineProperties(p,{
			select:{get:p._get_select,set:p._set_select}
		});
	} catch (e) {}
	
	as.Radio = cjs.promote(as.Radio, "Container");
})(createjs = createjs||{}, ascainiao = ascainiao||{});
var createjs, ascainiao;